Crispo - Excel Challenge 45 2024

excel-challenges
weekly-exercises
Easy Sunday Excel Challenge
Published

November 10, 2024

Illustration for Crispo - Excel Challenge 45 2024

Challenge Description

Easy Sunday Excel Challenge

⭐ Item_5090_Group_4800_Location Item_5090_Group_4850_Location Item_5120_Group_4850_Location Item_5120_Group_4900_Location Item_5121_Group_5050_Location

Solutions

library(tidyverse)
library(readxl)

path = "files/Excel Challenge Nov 10th.xlsx"
input = read_excel(path, range = "B3:B16")

result = input %>%
  mutate(change = Items != lag(Items)) %>%
  replace_na(list(change = TRUE))

print(result)
  • Logic:

    • Reads the workbook range needed for the challenge

    • Builds the intermediate helper columns that drive the final answer

  • Strengths:

    • The R solution stays compact and mirrors the workbook logic closely.
  • Areas for Improvement:

    • The code assumes the workbook layout and named ranges remain stable.
  • Gem:

    • The best part of the solution is choosing a tidy intermediate shape before producing the final answer.
import pandas as pd

path = "files/Excel Challenge Nov 10th.xlsx"
input = pd.read_excel(path, usecols="B", skiprows=2, nrows=14)

input['change'] = input['Items'].ne(input['Items'].shift()).fillna(True)
print(input)
  • Logic:

    • Reads the workbook range needed for the challenge
  • Strengths:

    • The Python version keeps the same rule in a direct pandas-oriented workflow.
  • Areas for Improvement:

    • As with the R version, any workbook layout change would require small adjustments.
  • Gem:

    • The implementation stays close to the stated challenge instead of adding unnecessary complexity.

Difficulty Level

This task is easy to moderate:

  • The business rule is readable, but the workbook still needs a few careful transformation steps.